﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;

namespace blackhouse.StareKino.Web.Events {
    public class PostLiteralSubtitle : Control {

        #region Fields

        private CinemaPostModel postModel;

        #endregion

        #region Methods

        protected override void OnLoad(EventArgs e) {
            base.OnLoad(e);

            this.postModel = new CinemaPostModel();
        }

        protected override void Render(HtmlTextWriter writer) {
            writer.Write(this.postModel.Post.GetEventDate().ToString("D"));
            if (this.postModel.Post.HaveLocation())
                writer.Write(", " + this.postModel.Post.GetLocation().LocationName);
        }

        #endregion

    }
}